package com.gator.desig_mode.obsever;

import org.omg.CORBA.Object;

public interface Observer {

  void update(Info info);

}


class Xilang implements Observer {

  @Override
  public void update(Info info) {
    System.out.println("新浪收到信息" + info.toString());
  }
}


class Baidu implements Observer {

  @Override
  public void update(Info info) {
    System.out.println("百度收到信息" + info.toString());
  }

}


class Info {

  private int wendu;


  private int shidu;

  public Info(int wendu, int shidu) {
    this.wendu = wendu;
    this.shidu = shidu;
  }

  public Info() {
  }

  public int getWendu() {
    return wendu;
  }

  public void setWendu(int wendu) {
    this.wendu = wendu;
  }

  public int getShidu() {
    return shidu;
  }

  public void setShidu(int shidu) {
    this.shidu = shidu;
  }

  @Override
  public String toString() {
    return "Info{" +
        "wendu=" + wendu +
        ", shidu=" + shidu +
        '}';
  }
}
